//OUTDOOR SCRIPT TEMPLATE
beginoutdoorscript;

variables;
short choice;

body;

beginstate INIT_STATE;
// This state called whenever this section is loaded into memory.
break;

beginstate START_STATE;
break;

beginstate 10;
if (get_flag(200,0) == 3) {
	message_dialog("Fine. Fine! Don't believe me! I only MADE this damn scenario, but what do I know?! Nothing, apparently! Nothing at all! Go back there if you want! Go! Go ahead! I'm not stopping you!","");
	inc_flag(200,0,1);
	}
if (get_flag(200,0) == 2) {
	block_entry(1);
	message_dialog("Seriously, it sucks. There's nothing back there.","");
	inc_flag(200,0,1);
	}
if (get_flag(200,0) == 1) {
	block_entry(1);
	message_dialog("Like I said, there's nothing interesting back there. That's the way you came.","");
	inc_flag(200,0,1);
	}
if (get_flag(200,0) == 0) {
	block_entry(1);
	message_dialog("That's back the way you came. There's nothing interesting back there.","");
	inc_flag(200,0,1);
	}
break;

beginstate 11;
	message_dialog("Told you it sucks.","");
break;

beginstate 12;
if (get_flag(200,1) == 0) {
	set_flag(200,1,1);
	message_dialog("This was once a prosperous, thriving town. Then, very recently if you are to judge by appearances, it was attacked by a plague of monsters. The monsters seem to have been eliminated, as if their source was destroyed soon after they arrived.","If this monster plague had been stopped just a few days earlier, this town might not have been destroyed. Of course, since you didn't know about the monster plague, there was nothing that you could have done.");
	}
break;

beginstate 13;
if (get_flag(4,3) == 0)
	block_entry(1);
break;

beginstate 14;
	reset_dialog();
	add_dialog_str(0,"You encounter a sizable band of guards on this bridge. They look like legitimate soldiers from the area.",0);
	add_dialog_str(1,"_Halt!_ they say to you. _Who goes there? Do you have authorization to cross this bridge?_",0);
	add_dialog_choice(0,"Tell them who you are.");
	add_dialog_choice(1,"Attack!");
	if (get_flag(0,7))
		add_dialog_choice(2,"Tell them Machrone sent you.");
	choice = run_dialog(1);
	if (choice == 1) {
		message_dialog("_Never heard of you,_ one of them says. _You need authorization to pass this bridge. You don't have it. Go back to Pleasant Town._ They move to block your path and prevent you from crossing.","How rude.");
		outdoor_enc_result(1);
		}
	if (choice == 2) {
		message_dialog("You charge heroically (and stupidly) into needless battle! Kill first and ask questions later!!","");
		outdoor_enc_result(0);
		}
	if (choice == 3) {
		message_dialog("_Machrone sent you?_ one says. _To speak with Dan?_ They confer quickly. _You can pass,_ they conclude, and they step out of your way.","");
		outdoor_enc_result(3);
		}
break;

beginstate 15;
if (get_flag(200,3) == 0) {
	set_flag(200,3,1);
	message_dialog("As you approach the end of the tunnel, you can see the secret back entrance to the archmage's castle. This is it! It is now time to charge in heroically and finally win that fortune and glory that Machrone was talking about.","Specifically, fortune and glory!! Or something.");
	}
break;

beginstate 16;
	reset_dialog();
	add_dialog_str(0,"This is the path leading out of this area. West of here is the Land of Oaks, and beyond that is the land owned by the Company of Saint Francis.",0);
	if (get_flag(0,8) == 0) 
		add_dialog_str(1,"You still have much to do here. Your work is quite incomplete. But if you're tired of the abuse, you can leave.",0);
	else
		add_dialog_str(1,"You are done here. It would be nice to say that you have accomplished much, but that would be lying. You have accomplished nothing here. But then, this wasn't your adventure to have, really.",0);
	add_dialog_str(2,"Would you like to leave here and travel on to the Land of the Oaks and then to the land of St. Francis Co.?",0);
	add_dialog_choice(0,"No. We'll stay here a little longer.");
	add_dialog_choice(1,"Yes. Onward! Excelsior!");
	if (run_dialog(1) == 1)
		block_entry(1);
	else {
		if (get_flag(0,8) == 0) {
			message_dialog("Wimp.","");
			end_scenario(0);
			}
		else {
			message_dialog("Well, at least it's over.","");
			end_scenario(1);
			}
		}
break;

beginstate 17;
	message_dialog("You boldly walk right up to the front door of the archmage's castle, hoping to knock on the door and get let in. Before you can get within ten yards of the door, you are transfixed: you cannot move forward.","You start moving backward, and you find that retreat is easy, but some spell prevents you from walking forward. This magic is well over your head; you cannot enter this way.");
	block_entry(1);
break;